package web.mapper;

import java.math.BigDecimal;
import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import web.pojo.Goods;

public interface GoodsMapper {

    @Select("insert into hbeu_goods(name, price) values(#{name}, #{price})")
    public void addGoods(@Param("name") String name, @Param("price") BigDecimal price);

    @Select("delete from hbeu_goods where id = #{id}")
    public void deleteGoods(@Param("id") Integer id);

    @Select("select id, name, price from hbeu_goods limit #{offset}, #{limit}")
    public List<Goods> queryGoods(@Param("offset") Integer offset, @Param("limit") Integer limit);

    @Select("select count(1) from hbeu_goods")
    public Integer count();
}
